<!-- 出库订单详情 -->
<template>
  <div class="page-container" v-loading="loading" v-loadingCommonStyle>
    <ex_header_spiler :title="$t('label_base_info')" />
    <ex_super_desc v-bind="baseOption" :data="form"/>
    <ex_header_spiler :title="$t('label_forecast_good_detail')" />
    <ex_super_table :model="tableModel" :data="form.orderBoxDetailList" size="default" />
  </div>
</template>
<script>
import router_params from '@/mixin/router_params';

export default {

  title: "title_appointment_report_detail",
  mixins: [router_params],
  components: {},
  data() {
    return {
      loading: false,

      form:{},
      baseOption: {
        attrs: this.$defaultDetailDescAttrs,
        model: [
          { key: 'transitNo', label: 'label_waybill_code', },
          { key: 'gmtCreate', label: 'label_schedule_appointment_time',formatter: (r, c, v, i) => this.$dateFormat(v) },
          { key: 'scheduleTypeEnum', label: 'label_schedule_method',formatter: (r, c, v, i) => this.$enumShow(v, "ScheduleTypeEnum") },
          { key: 'gmtModify', label: 'label_update_time',formatter: (r, c, v, i) => this.$dateFormat(v) },
          { key: 'expectPackagingQty', label: 'label_declared_package_number' },
          { key: 'expectBoxQty', label: 'label_declared_box_number' },
          { key: 'vehicleNo', label: 'label_car_number' },
          { key: 'driverName', label: 'label_driver_name' },
          { key: 'driverPhone', label: 'label_driver_phone' },
          { key: 'volumn', label: 'label_declare_goods_sum_volume' },
          { key: 'weight', label: 'label_declare_goods_sum_weight' },
          { key: 'reporter', label: 'label_declare_user' },
          { key: 'scheduleStatusEnum', label: 'label_schedule_status',formatter: (r, c, v, i) => this.$enumShow(v, "ScheduleStatusEnum") },
          { key: 'checkUserName', label: 'label_audit_user' },
          { key: 'checkTime', label: 'label_audit_time',formatter: (r, c, v, i) => this.$dateFormat(v) },
          { key: 'refuseReason', label: 'label_reject_reason' },
        ],
      },
      tableModel: [
        { key: "boxNumber", label: "label_index_number",'min-width':140, },
        { key: "inboundOrderCode", label: "title_inbound_order", 'min-width':140,},
        { key: "packageNo", label:'label_big_package_code', 'show-overflow-tooltip': true },
        { key: "boxNo", label: "label_box_code", 'show-overflow-tooltip': true },
        { key: "skuOnlyCode", label: "label_sku_only_code", 'show-overflow-tooltip': true },
        { key: "skuName", label: "label_sku_name", 'show-overflow-tooltip': true },
        { key: "quantity", label: "label_sku_count", 'show-overflow-tooltip': true },
        { key: "receivingQty", label: "label_actual_receiving_number", 'show-overflow-tooltip': true },
      ]
    };
  },

  methods: {
    init_data_default(into_params) {
      if (into_params.id) {
        this.loading = true
        this.$ajax({
          url: "/oms-api/order/OmsInboundScheduleRpc/detailAdmin.json",
          method: 'post',
          data: { scheduleId: into_params.id },
          success: (res) => {
            this.loading = false
            this.form = res.data

            this.fixTabLabel()
          }
        })
      }
      this.fixTabLabel()
    },
    fixTabLabel() {
      if (!!this.form.transitNo) {
        this.$emit("tagModifyLabel", { _key: 'label_name_code', name: this.$tt('title_appointment_report_detail'), code: this.form.transitNo || '' })

      } else {
        this.$emit("tagModifyLabel", "title_appointment_report_detail")
      }
    },
  }
};

</script>
<style></style>
